# coding: utf-8

import pandas as pd
df = pd.read_csv(r'F:\Work\Python\Pandas\study-pandas\file\datas\weather_20230115134249.csv')
print(df.head())

df.loc[:, '气温(度)']=df['气温(度)'].str.replace('℃','').astype('float64')
# 1. describe综合统计
# print(df.describe())
# print(df['相对湿度(%)'].mean())  #平均值

# 2. 去重和统计数量
# print(df['城市'].unique())  #去重后的枚举值
# print(df['城市'].nunique())  #去重后的枚举数量 
# print(df['城市'].value_counts())  #汇总

# 3. 协方差和相关系数
#print(df.cov())
print(df.corr())
print(df['累积雨量(mm)'].corr(df['相对湿度(%)']))
